<?php


// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();

jimport( 'joomla.application.component.model' );


class AplicacionModelTagCloud extends JModel
{
 	var $datos;
 	
    function introduceSitio($post,$pathFoto)
    {
	    JTable::addIncludePath(JPATH_COMPONENT.DS.'tables'); //En Back-End no es necesario?!!
	    $file = JRequest::getVar( 'foto', null, 'files', 'array' );
	    $row =& JTable::getInstance('zsitio', 'Table');
	 	if (!$row->bind($post)) 
	 	{
	 	 	//return JError::raiseWarning(500, $row->getError());
	 	 	return 0;
	 	}
	 	if($pathFoto != null){$row->foto = $pathFoto.DS. $file['name'] ;}else{$row->foto = "Este sitio no tiene foto";}
	 	if (!$row->store()) 
	 	{
	  		//return JError::raiseWarning(500, $row->getError());
	      	return 0;
	 	}
	  	return 1;	
    }
    
	function getTags()
	{
		return $this->_getList( "select * from jos_ztag;");
    	
	}
  

}
?>